package Controller;


import lejos.robotics.navigation.TachoPilot;
import lejos.robotics.proposal.DifferentialPilot;
import lejos.robotics.subsumption.*;

public class DriveForward implements Behavior{
	private boolean suppressed = false;
	private TachoPilot pilot;
	
	public DriveForward(TachoPilot pilot){
		this.pilot = pilot;
	}
	
	public boolean takeControl(){
		//Standaardgedrag van de robot is vooruitgaan
		return true; 
	}
	
	public void suppress(){
		System.out.println("Drive supp");
		pilot.stop();
		suppressed = true;
	}
	
	public void action(){
		suppressed = false;	
		System.out.println("DriveForward");
		
		pilot.forward();
		
		while(!suppressed)Thread.yield();
	}
	
	

}
